import request from '@/utils/request';

// 获取购物车商品
export function getCartItems(userId) {
  return request({
    url: `/api/carts/${userId}`,
    method: 'get',
  });
}

// 添加商品到购物车
export function addToCart(data) {
  return request({
    url: '/api/carts',
    method: 'post',
    data,
  });
}

// 从购物车移除商品
export function removeFromCart(productId) {
  return request({
    url: `/api/carts/${productId}`,
    method: 'delete',
  });
} 